System and method for aggregating query results in a fault-tolerant database management system

ABSTRACT

A redundant array of independent nodes are networked together. Each node executes an instance of an application that provides object-based storage. Metadata objects are stored in a set of regions distributed among the nodes across the array. A given region is identified by hashing a metadata object attribute and extracting a given set of bits of a resulting hash value. A method of managing query results comprises: receiving, by a first node of the plurality of independent nodes from a client application, a request for a list of objects with a criterion; issuing by the first node a query to all the nodes based on the received request; processing the query by each node over the regions in the node using the metadata objects stored in the regions; aggregating and filtering by the first node results of the query from all the nodes; and returning by the first node the aggregated and filtered results to the client application.

BACKGROUND OF THE INVENTION

The present invention relates generally to storage systems and, moreparticularly, to system and method for aggregating query results in afault-tolerant database management system.

Customers can have different integration needs with a content platformbased on their business needs and scenarios. One common theme surroundsretrieving a list of objects and information on those objects to pass toanother application in their infrastructure for a specific function(e.g., searching data or backing up data). To do this, the applicationsmay be required to do more work to retrieve this information. Forinstance, the integrating application would have to traverse adirectory, subdirectories, sub-subdirectories, and so forth to retrievea list of objects and system metadata for a given criterion. This wouldhave to be done for all directories in a namespace, across allnamespaces of interest, across all tenants of interest, etc., for thecase where a redundant array of independent nodes are networked togetherand each cluster/system of nodes is partitioned into tenants andnamespaces. A namespace is a logical partition of the cluster, andessentially serves as a collection of objects particular to at least onedefined application. Each namespace has a private filesystem withrespect to other namespaces. Moreover, access to one namespace does notgrant a user access to another namespace. A tenant is a grouping ofnamespace(s) and possibly other subtenants. A cluster/system is aphysical archive instance. See commonly assigned U.S. patent applicationSer. No. 12/609,804, filed Oct. 30, 2009, entitled Fixed Content StorageWithin a Partitioned Content Platform Using Namespaces, which isincorporated herein by reference.

BRIEF SUMMARY OF THE INVENTION

Exemplary embodiments of the invention allow REST (RepresentationalState Transfer) clients to query a content platform for lists of objectsand metadata that match a given criterion without the need for theintegrating application to traverse a directory, subdirectories,sub-subdirectories, and so forth to retrieve a list of objects andsystem metadata for the given criterion. For example, a clientapplication may query by change time, query by directory, query bytransaction (create, delete, purge), query by namespace, or page throughresults. With this invention, a single content platform node distributesthe query to all regions across all the nodes in the content platformsystem and the same node sorts the results before returning the listback to the client application. In this way, the content platform systemshoulders more of the burden of this work by querying across all thenodes in the content platform system, filtering and sorting the results,and then returning the results to the client application.

An aspect of the present invention is directed to a redundant array ofindependent nodes networked together, wherein each node executes aninstance of an application that provides object-based storage, whereinmetadata objects are stored in a set of regions distributed among thenodes across the array, and wherein a given region is identified byhashing a metadata object attribute and extracting a given set of bitsof a resulting hash value. A method of managing query results comprises:receiving, by a first node of the plurality of independent nodes from aclient application, a request for a list of objects with a criterion;issuing by the first node a query to all the nodes based on the receivedrequest; processing the query by each node over the regions in the nodeusing the metadata objects stored in the regions; aggregating andfiltering by the first node results of the query from all the nodes; andreturning by the first node the aggregated and filtered results to theclient application.

In some embodiments, processing the query by each node comprisesproviding the results of the query in sets to the first node, and theresults of the query from all the nodes are aggregated and filtered andreturned to the client application in sets. The method further comprisesafter returning by the first node a current set of the aggregated andfiltered results to the client application, awaiting a request from theclient application for a next set of results before requesting andretrieving the next set of results from all the nodes. Providing theresults of the query in sets to the first node comprises providing apreset number of objects from each region as a result of processing thequery. The method further comprises sorting by the first node theaggregated and filtered results to produce a preset ordering. Therequest includes one or more of query by change time, query bydirectory, query by transaction, query by namespace, and page throughresults.

Another aspect of the invention is directed to an apparatus for managingquery results in a redundant array of independent nodes networkedtogether, wherein each node executes an instance of an application thatprovides object-based storage, wherein metadata objects are stored in aset of regions distributed among the nodes across the array, and whereina given region is identified by hashing a metadata object attribute andextracting a given set of bits of a resulting hash value. The apparatuscomprising a processor, a memory, and a query results management moduleprovided for each of the nodes. The query results management module isconfigured to: if the node having the query results management module isa first node which receives from a client application a request for alist of objects with a criterion, issue a query to all the nodes basedon the received request; process the query over the regions in the nodeusing the metadata objects stored in the regions; and if the node havingthe query results management module is the first node, aggregate andfilter results of the query from all the nodes, the aggregated andfiltered results to be returned to the client application.

In specific embodiments, a node comprises a metadata manager to managethe metadata objects in the node which includes organizing and providingaccess to the metadata objects, wherein the metadata manager includesthe query results management module of the node.

Another aspect of this invention is directed to a computer-readablestorage medium storing a plurality of instructions for controlling adata processor to manage query results in a redundant array ofindependent nodes networked together, wherein each node executes aninstance of an application that provides object-based storage, whereinmetadata objects are stored in a set of regions distributed among thenodes across the array, wherein a given region is identified by hashinga metadata object attribute and extracting a given set of bits of aresulting hash value, and wherein the computer-readable storage mediumis provided in each node. The plurality of instructions comprisesinstructions that cause the data processor, if the node having thecomputer-readable storage medium is a first node which receives from aclient application a request for a list of objects with a criterion, toissue a query to all the nodes based on the received request;instructions that cause the data processor to process the query over theregions in the node using the metadata objects stored in the regions;and instructions that cause the data processor, if the node having thecomputer-readable storage medium is the first node, to aggregate andfilter by the first node results of the query from all the nodes, theaggregated and filtered results to be returned to the clientapplication.

These and other features and advantages of the present invention willbecome apparent to those of ordinary skill in the art in view of thefollowing detailed description of the specific embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a simplified block diagram of a fixed content storage archivein which the method and apparatus of the invention may be applied.

FIG. 2 is a simplified representation of a redundant array ofindependent nodes each of which is symmetric and supports an archivecluster application.

FIG. 3 is a high level representation of the various components of thearchive cluster application executing on a given node.

FIG. 4 illustrates an example of the components of the metadatamanagement system on a given node of the cluster.

FIG. 5 is a simplified block diagram of a content platform illustratingthe distribution of a query from a client application by a single nodeto all other nodes and aggregating the query results to be returned tothe client application.

FIG. 6 is an example of a flow diagram illustrating a process fordistributing a query from a client application by a single node to allother nodes and aggregating and returning results of the query to theclient application by the single node.

DETAILED DESCRIPTION OF THE INVENTION

In the following detailed description of the invention, reference ismade to the accompanying drawings which form a part of the disclosure,and in which are shown by way of illustration, and not of limitation,exemplary embodiments by which the invention may be practiced. In thedrawings, like numerals describe substantially similar componentsthroughout the several views. Further, it should be noted that while thedetailed description provides various exemplary embodiments, asdescribed below and as illustrated in the drawings, the presentinvention is not limited to the embodiments described and illustratedherein, but can extend to other embodiments, as would be known or aswould become known to those skilled in the art. Reference in thespecification to “one embodiment,” “this embodiment,” or “theseembodiments” means that a particular feature, structure, orcharacteristic described in connection with the embodiment is includedin at least one embodiment of the invention, and the appearances ofthese phrases in various places in the specification are not necessarilyall referring to the same embodiment. Additionally, in the followingdetailed description, numerous specific details are set forth in orderto provide a thorough understanding of the present invention. However,it will be apparent to one of ordinary skill in the art that thesespecific details may not all be needed to practice the presentinvention. In other circumstances, well-known structures, materials,circuits, processes and interfaces have not been described in detail,and/or may be illustrated in block diagram form, so as to notunnecessarily obscure the present invention.

Furthermore, some portions of the detailed description that follow arepresented in terms of algorithms and symbolic representations ofoperations within a computer. These algorithmic descriptions andsymbolic representations are the means used by those skilled in the dataprocessing arts to most effectively convey the essence of theirinnovations to others skilled in the art. An algorithm is a series ofdefined steps leading to a desired end state or result. In the presentinvention, the steps carried out require physical manipulations oftangible quantities for achieving a tangible result. Usually, though notnecessarily, these quantities take the form of electrical or magneticsignals or instructions capable of being stored, transferred, combined,compared, and otherwise manipulated. It has proven convenient at times,principally for reasons of common usage, to refer to these signals asbits, values, elements, symbols, characters, terms, numbers,instructions, or the like. It should be borne in mind, however, that allof these and similar terms are to be associated with the appropriatephysical quantities and are merely convenient labels applied to thesequantities. Unless specifically stated otherwise, as apparent from thefollowing discussion, it is appreciated that throughout the description,discussions utilizing terms such as “processing,” “computing,”“calculating,” “determining,” “displaying,” or the like, can include theactions and processes of a computer system or other informationprocessing device that manipulates and transforms data represented asphysical (electronic) quantities within the computer system's registersand memories into other data similarly represented as physicalquantities within the computer system's memories or registers or otherinformation storage, transmission or display devices.

The present invention also relates to an apparatus for performing theoperations herein. This apparatus may be specially constructed for therequired purposes, or it may include one or more general-purposecomputers selectively activated or reconfigured by one or more computerprograms. Such computer programs may be stored in a computer-readablestorage medium, such as, but not limited to optical disks, magneticdisks, read-only memories, random access memories, solid state devicesand drives, or any other types of media suitable for storing electronicinformation. The algorithms and displays presented herein are notinherently related to any particular computer or other apparatus.Various general-purpose systems may be used with programs and modules inaccordance with the teachings herein, or it may prove convenient toconstruct a more specialized apparatus to perform desired method steps.In addition, the present invention is not described with reference toany particular programming language. It will be appreciated that avariety of programming languages may be used to implement the teachingsof the invention as described herein. The instructions of theprogramming language(s) may be executed by one or more processingdevices, e.g., central processing units (CPUs), processors, orcontrollers.

Exemplary embodiments of the invention, as will be described in greaterdetail below, provide apparatuses, methods and computer programs foraggregating query results in a fault-tolerant database managementsystem.

I. Fixed Content Distributed Data Storage

A need has developed for the archival storage of “fixed content” in ahighly available, reliable and persistent manner that replaces orsupplements traditional tape and optical storage solutions. The term“fixed content” typically refers to any type of digital information thatis expected to be retained without change for reference or otherpurposes. Examples of such fixed content include, among many others,e-mail, documents, diagnostic images, check images, voice recordings,film and video, and the like. The traditional Redundant Array ofIndependent Nodes (RAIN) storage approach has emerged as thearchitecture of choice for creating large online archives for thestorage of such fixed content information assets. By allowing nodes tojoin and exit from a cluster as needed, RAIN architectures insulate astorage cluster from the failure of one or more nodes. By replicatingdata on multiple nodes, RAIN-type archives can automatically compensatefor node failure or removal. Typically, RAIN systems are largelydelivered as hardware appliances designed from identical componentswithin a closed system.

FIG. 1 illustrates one such scalable disk-based archival storagemanagement system. The nodes may comprise different hardware and thusmay be considered “heterogeneous.” A node typically has access to one ormore storage disks, which may be actual physical storage disks, orvirtual storage disks, as in a storage area network (SAN). The archivecluster application (and, optionally, the underlying operating system onwhich that application executes) that is supported on each node may bethe same or substantially the same. The software stack (which mayinclude the operating system) on each node is symmetric, whereas thehardware may be heterogeneous. Using the system, as illustrated in FIG.1, enterprises can create permanent storage for many different types offixed content information such as documents, e-mail, satellite images,diagnostic images, check images, voice recordings, video, and the like,among others. These types are merely illustrative, of course. Highlevels of reliability are achieved by replicating data on independentservers, or so-called storage nodes. Preferably, each node is symmetricwith its peers. Thus, because preferably any given node can perform allfunctions, the failure of any one node has little impact on thearchive's availability.

As described in commonly-owned U.S. Pat. No. 7,155,466, it is known in aRAIN-based archival system to incorporate a distributed softwareapplication executed on each node that captures, preserves, manages, andretrieves digital assets. FIG. 2 illustrates one such system. A physicalboundary of an individual archive is referred to as a cluster (or asystem). Typically, a cluster is not a single device, but rather acollection of devices. Devices may be homogeneous or heterogeneous. Atypical device is a computer or machine running an operating system suchas Linux. Clusters of Linux-based systems hosted on commodity hardwareprovide an archive that can be scaled from a few storage node servers tomany nodes that store thousands of terabytes of data. This architectureensures that storage capacity can always keep pace with anorganization's increasing archive requirements.

In storage systems such as described above, data typically isdistributed across the cluster randomly so that the archive is alwaysprotected from device failure. If a disk or node fails, the clusterautomatically fails over to other nodes in the cluster that maintainreplicas of the same data. While this approach works well from a dataprotection standpoint, a calculated mean time to data loss (MTDL) forthe cluster may not be as high as desired. In particular, MTDL typicallyrepresents a calculated amount of time before the archive will losedata. In a digital archive, any data loss is undesirable, but due to thenature of hardware and software components, there is always apossibility (however remote) of such an occurrence. Because of therandom distribution of objects and their copies within an archivecluster, MTDL may end up being lower than required since, for example, aneeded copy of an object may be unavailable if a given disk (on which amirror copy is stored) within a given node fails unexpectedly.

As shown in FIG. 2, an illustrative cluster in which the presentinvention is implemented preferably comprises the following generalcategories of components: nodes 202, a pair of network switches 204,power distribution units (PDUs) 206, and uninterruptible power supplies(UPSs) 208. A node 202 typically comprises one or more commodity serversand contains a CPU (e.g., Intel x86, suitable random access memory(RAM), one or more hard drives (e.g., standard IDE/SATA, SCSI, or thelike), and two or more network interface (NIC) cards. A typical node isa 2U rack mounted unit with a 2.4 GHz chip, 512 MB RAM, and six (6) 200GB hard drives. This is not a limitation, however. The network switches204 typically comprise an internal switch 205 that enables peer-to-peercommunication between nodes, and an external switch 207 that allowsextra-cluster access to each node. Each switch requires enough ports tohandle all potential nodes in a cluster. Ethernet or GigE switches maybe used for this purpose. PDUs 206 are used to power all nodes andswitches, and the UPSs 208 are used that protect all nodes and switches.Although not meant to be limiting, typically a cluster is connectable toa network, such as the public Internet, an enterprise intranet, or otherwide area or local area network. In an illustrative embodiment, thecluster is implemented within an enterprise environment. It may bereached, for example, by navigating through a site's corporate domainname system (DNS) name server. Thus, for example, the cluster's domainmay be a new sub-domain of an existing domain. In a representativeimplementation, the sub-domain is delegated in the corporate DNS serverto the name servers in the cluster itself. End users access the clusterusing any conventional interface or access tool. Thus, for example,access to the cluster may be carried out over any IP-based protocol(HTTP, FTP, NFS, AFS, SMB, a Web service, or the like), via an API, orthrough any other known or later-developed access method, service,program, or tool.

Client applications access the cluster through one or more types ofexternal gateways such as standard UNIX file protocols, or HTTP APIs.The archive preferably is exposed through a virtual file system that canoptionally sit under any standard UNIX file protocol-oriented facility.These include NFS, FTP, SMB/CIFS, or the like.

In one embodiment, the archive cluster application runs on a redundantarray of independent nodes (H-RAIN) that are networked together (e.g.,via Ethernet) as a cluster. The hardware of given nodes may beheterogeneous. For maximum reliability, however, preferably each noderuns an instance 300 of the distributed application (which may be thesame instance, or substantially the same instance), which comprisesseveral runtime components as now illustrated in FIG. 3. Thus, whilehardware may be heterogeneous, the software stack on the nodes (at leastas it relates to the present invention) is the same. These softwarecomponents comprise a gateway protocol layer 302, an access layer 304, afile transaction and administration layer 306, and a core componentslayer 308. The “layer” designation is provided for explanatory purposes,as one of ordinary skill will appreciate that the functions may becharacterized in other meaningful ways. One or more of the layers (orthe components therein) may be integrated or otherwise. Some componentsmay be shared across layers.

The gateway protocols in the gateway protocol layer 302 providetransparency to existing applications. In particular, the gatewaysprovide native file services such as NFS 310 and SMB/CIFS 312, as wellas a Web services API to build custom applications. HTTP support 314 isalso provided. The access layer 304 provides access to the archive. Inparticular, according to the invention, a Fixed Content File System(FCFS) 316 emulates a native file system to provide full access toarchive objects. FCFS gives applications direct access to the archivecontents as if they were ordinary files. Preferably, archived content isrendered in its original format, while metadata is exposed as files.FCFS 316 provides conventional views of directories and permissions androutine file-level calls, so that administrators can provisionfixed-content data in a way that is familiar to them. File access callspreferably are intercepted by a user-space daemon and routed to theappropriate core component (in layer 308), which dynamically creates theappropriate view to the calling application. FCFS calls preferably areconstrained by archive policies to facilitate autonomous archivemanagement. Thus, in one example, an administrator or application cannotdelete an archive object whose retention period (a given policy) isstill in force.

The access layer 304 preferably also includes a Web user interface (UI)318 and an SNMP gateway 320. The Web user interface 318 preferably isimplemented as an administrator console that provides interactive accessto an administration engine 322 in the file transaction andadministration layer 306. The administrative console 318 preferably is apassword-protected, Web-based GUI that provides a dynamic view of thearchive, including archive objects and individual nodes. The SNMPgateway 320 offers storage management applications easy access to theadministration engine 322, enabling them to securely monitor and controlcluster activity. The administration engine monitors cluster activity,including system and policy events. The file transaction andadministration layer 306 also includes a request manager process 324.The request manager 324 orchestrates all requests from the externalworld (through the access layer 304), as well as internal requests froma policy manager 326 in the core components layer 308.

In addition to the policy manager 326, the core components also includea metadata manager 328, and one or more instances of a storage manager330. A metadata manager 328 preferably is installed on each node.Collectively, the metadata managers in a cluster act as a distributeddatabase, managing all archive objects. On a given node, the metadatamanager 328 manages a subset of archive objects, where preferably eachobject maps between an external file (“EF,” the data that entered thearchive for storage) and a set of internal files (each an “IF”) wherethe archive data is physically located. The same metadata manager 328also manages a set of archive objects replicated from other nodes. Thus,the current state of every external file is always available to multiplemetadata managers on several nodes. In the event of node failure, themetadata managers on other nodes continue to provide access to the datapreviously managed by the failed node. The storage manager 330 providesa file system layer available to all other components in the distributedapplication. Preferably, it stores the data objects in a node's localfile system. Each drive in a given node preferably has its own storagemanager. This allows the node to remove individual drives and tooptimize throughput. The storage manager 330 also provides systeminformation, integrity checks on the data, and the ability to traversedirectly local structures.

As also illustrated in FIG. 3, the cluster manages internal and externalcommunication through a communications middleware layer 332 and a DNSmanager 334. The infrastructure 332 is an efficient and reliablemessage-based middleware layer that enables communication among archivecomponents. In an illustrated embodiment, the layer supports multicastand point-to-point communications. The DNS manager 334 runs distributedname services that connect all nodes to the enterprise server.Preferably, the DNS manager (either alone or in conjunction with a DNSservice) load balances requests across all nodes to ensure maximumcluster throughput and availability.

In an illustrated embodiment, the ArC application instance executes on abase operating system 336, such as Red Hat Linux 9.0, Fedora Core 6, orthe like. The communications middleware is any convenient distributedcommunication mechanism. Other components may include FUSE (Filesystemin USErspace), which may be used for the Fixed Content File System(FCFS) 316. The NFS gateway 310 may be implemented by a standard nfsdLinux Kernel NFS driver. The database in each node may be implemented,for example, PostgreSQL (also referred to herein as Postgres), which isan object-relational database management system (ORDBMS). The node mayinclude a Web server, such as Jetty, which is a Java HTTP server andservlet container. Of course, the above mechanisms are merelyillustrative.

The storage manager 330 on a given node is responsible for managing thephysical storage devices. Preferably, each storage manager instance isresponsible for a single root directory into which all files are placedaccording to its placement algorithm. Multiple storage manager instancescan be running on a node at the same time, and each usually represents adifferent physical disk in the system. The storage manager abstracts thedrive and interface technology being used from the rest of the system.When the storage manager instance is asked to write a file, it generatesa full path and file name for the representation for which it will beresponsible. In a representative embodiment, each object to be stored ona storage manager is received as raw data to be stored, with the storagemanager then adding its own metadata to the file as it stores the datato keep track of different types of information. The external file (EF)stores the information that will be needed subsequently in query withthe Query Engine. By way of example, this metadata includes withoutlimitation: EF length (length of external file in bytes), IF Segmentsize (size of this piece of the Internal File), EF Protectionrepresentation (EF protection mode), IF protection role (representationof this internal file), EF Creation timestamp (external file timestamp),Signature (signature of the internal file at the time of the write(PUT), including a signature type), and EF Filename (external filefilename). Storing this additional metadata with the internal file dataprovides for additional levels of protection. In particular, scavengingcan create external file records in the database from the metadatastored in the internal files. Other policies can validate internal filehash against the internal file to validate that the internal fileremains intact.

Internal files may be “chunks” of data representing a portion of theoriginal “file” in the archive object, and they may be placed ondifferent nodes to achieve striping and protection blocks. This breakingapart of an external file into smaller chunked units is not arequirement, however; in the alternative, internal files may be completecopies of the external file. Typically, one external file entry ispresent in a metadata manager for each archive object, while there maybe many internal file entries for each external file entry. Typically,internal file layout depends on the system. In a given implementation,the actual physical format of this data on disk is stored in a series ofvariable length records.

The request manager 324 is responsible for executing the set ofoperations needed to perform archive actions by interacting with othercomponents within the system. The request manager supports manysimultaneous actions of different types, is able to roll-back any failedtransactions, and supports transactions that can take a long time toexecute. The request manager further ensures that read/write operationsin the archive are handled properly and guarantees all requests are in aknown state at all times. It also provides transaction control forcoordinating multiple read/write operations across nodes to satisfy agiven client request. In addition, the request manager caches metadatamanager entries for recently used files and provides buffering forsessions as well as data blocks.

A cluster's primary responsibility is to store an unlimited number offiles on disk reliably. A given node may be thought of as being“unreliable,” in the sense that it may be unreachable or otherwiseunavailable for any reason. A collection of such potentially unreliablenodes collaborate to create reliable and highly available storage.Generally, there are two types of information that need to be stored:the files themselves and the metadata about the files. Additionaldetails of the fixed content distributed data storage can be found inU.S. Patent Publications 2007/0189153 and 2006/0026219, which areincorporated herein by reference.

II. Metadata Management

A metadata management system is responsible for organizing and providingaccess to given metadata, such as system metadata. This system metadataincludes information on files placed in the archive, as well asconfiguration information, information displayed on the administrativeUI, metrics, information on irreparable policy violations, and the like.Although not illustrated in detail, other types of metadata (e.g., usermetadata associated with archived files) may also be managed using themetadata management system that is now described.

In a representative embodiment of the cluster, the metadata managementsystem provides persistence for a set of metadata objects, which mayinclude one or more of the following object types (which are merelyillustrative):

ExternalFile: a file as perceived by a user of the archive;

InternalFile: a file stored by the Storage Manager; typically, there maybe a one-to-many relationship between External Files and Internal Files.

ConfigObject: a name/value pair used to configure the cluster;

AdminLogEntry: a message to be displayed on the administrator UI;

MetricsObject: a timestamped key/value pair, representing somemeasurement of the archive (e.g., number of files) at a point in time;and

PolicyState: a violation of some policy.

Each metadata object may have a unique name that preferably neverchanges. Metadata objects are organized into regions. A region comprisesan authoritative region copy and a “tolerable points of failure” (TPOF)number (a set of zero or more) backup region copies. With zero copies,the metadata management system is scalable but may not be highlyavailable. A region is selected by hashing one or more object attributes(e.g., the object's name, such as a fully-qualified pathname, or portionthereof) and extracting a given number of bits of the hash value. Thesebits comprise a region number. The bits selected may be low order bits,high order bits, middle order bits, or any combination of individualbits. In a representative embodiment, the given bits are the low orderbits of the hash value. The object's attribute or attributes may behashed using any convenient hash function. These include, withoutlimitation, a Java-based hash function such asjava.lang.string.hashCode, and the like. Preferably, the number of bitscomprising the region number is controlled by a configuration parameter,referred to herein as regionMapLevel. If this configuration parameter isset to 6, for example, this results in 2⁶=64 regions. Of course, alarger number of regions are permitted, and the number of regions may beadjusted automatically using a namespace partitioning scheme.

Each region may be stored redundantly. As noted above, there is oneauthoritative copy of the region, and zero or more backup copies. Thenumber of backup copies is controlled by the metadata TPOF configurationparameter, as has been described. Preferably, region copies aredistributed across all the nodes of the cluster so as to balance thenumber of authoritative region copies per node, and to balance thenumber of total region copies per node.

The metadata management system stores metadata objects in a databaserunning on each node. This database is used to support the region map.An exemplary database is implemented using PostgreSQL, which isavailable as open source. Preferably, there is a schema for each regioncopy, and in each schema there is a table for each type of metadataobject. A schema is simply a namespace that can own tables, indexes,procedures, and other database objects. Each region preferably has itsown schema. Each schema has a complete set of tables, one for eachmetadata object. A row in one of these tables corresponds to a singlemetadata object. While Postgres is a preferred database, any convenientrelational database (e.g., Oracle, IBM DB/2, or the like) may be used.

As illustrated in FIG. 4, each node 400 has a set of processes orcomponents: one or more region managers (RGM) 402 a-n, a metadatamanager (MM) 404, at least one metadata manager client (MMC) 406, and adatabase 408 having one or more schemas 410 a-n. The RGM(s), MM and MMCcomponents execute with a virtual machine 412, such as a Java virtualmachine. There is one RGM for each region copy. Thus, there is an RGMfor the authoritative region copy, an RGM for each backup region copy,and an RGM for each incomplete region copy. There is also a databaseschema 410 for each RGM 402, which manages that schema. The databasealso stores the region map 405. Each node preferably has the same globalview of the region map, with requirement being enforced by asynchronization scheme. A region manager RGM 402 is responsible foroperating on a region copy (be it authoritative, backup or incomplete,as the case may be), and for executing requests submitted by themetadata manager clients 406 and by other region managers 402. Requestsare provided to a given RGM through any convenient means, such as thecommunications middleware or other messaging layer illustrated in FIG.3. The region manager provides an execution environment in which theserequests execute, e.g., by providing a connection to the database,configured to operate on the schema that is being managed by that RGM.Each region manager stores its data in the database 408. The metadatamanager 404 is a top-level component responsible for metadata managementon the node. It is responsible for creating and destroying regionmanagers (RGMs) and organizing resources needed by the RGMs, e.g.,cluster configuration information and a pool of database connections.Preferably, a given metadata manager (in a given node) acts as a leaderand is responsible for determining which metadata managers (across a setor subset of nodes) are responsible for which region copies. A leaderelection algorithm, such as the bully algorithm, or a variant thereof,may be used to select the metadata manager leader. Preferably, each nodehas a single metadata manager, although it is possible to run multipleMMs per node. Once region ownership has been established by thenamespace partitioning scheme (as will be described below), eachmetadata manager is responsible for adjusting its set of one or moreregion managers accordingly. System components (e.g., the administrativeengine, the policy manager, and the like) interact with the metadatamanager MM through the metadata manager client. The MMC is responsible(using the region map) for locating the RGM to carry out a givenrequest, for issuing the request to the selected RGM, and for retryingthe request if the selected RGM is unavailable (because, for example,the node has failed). In the latter case, a retry request will succeedwhen a new region map is received at the node.

As mentioned above, a region map identifies the node responsible foreach copy of each region. The virtual machine 412 (and each RGM, MM andMMC component therein) has access to the region map 405; a copy 420 ofthe region map, after it has been copied into the JVM, is also shown inFIG. 4. The region map thus is available to both the JVM and thedatabase in a given node. In this illustrative embodiment, each metadataobject has an attribute (e.g., a name), which is hashed to yield aninteger between 0x0 and 0x3fffffff inclusive, i.e., 30-bit values. Thesevalues can be represented comfortably in a signed 32-bit integer withoutrunning into overflow issues (e.g., when adding 1 to the high end of therange). The 30 bits allow for up to approximately 1 billion regions,which is sufficient even for large clusters. A region represents a setof hash values, and the set of all regions covers all possible hashvalues. There is a different bit position for each region, and thedifferent bit positions preferably are in a fixed order. Thus, eachregion is identified by a number, which preferably is derived byextracting the RegionLevelMap bits of the hash value. Where theconfiguration parameter is set to 6, allowing for 64 regions, theresulting hash values are the numbers 0x0 through 0x3f.

As previously noted, a region copy is in one of three (3) states:“authoritative,” “backup” and “incomplete.” If the region copy isauthoritative, all requests to the region go to this copy, and there isone authoritative copy for each region. If the region copy is a backup,the copy receives backup requests (from an authoritative region managerprocess). A region copy is incomplete if metadata is being loaded butthe copy is not yet synchronized (typically, with respect to otherbackup copies). An incomplete region copy is not eligible for promotionto another state until synchronization is complete, at which point thecopy becomes a backup copy. Each region has one authoritative copy and agiven number (as set by the metadataTPOF configuration parameter) backupor incomplete copies.

A backup region copy is kept synchronized with the authoritative regioncopy by enforcing a given protocol (or “contract”) between anauthoritative region copy and its TPOF backup copies. This protocol isnow described.

By way of brief background, when an update request is received at anMMC, the MMC does a lookup on the local region map to find the locationof the authoritative region copy. The MMC sends the update request tothe RGM associated with the authoritative region copy, which thencommits it. The update is also sent (by the RGM associated with theauthoritative region copy) to the RGM of each of the TPOF backup copies.The authoritative RGM, however, in order to indicate success, need notwait for each RGM associated with a backup region copy to commit theupdate; rather, when an RGM associated with a backup region copyreceives the update, it immediately returns or tries to return (to theauthoritative RGM) an acknowledgement. This acknowledgement is issuedwhen the backup request is received and before it is executed. In thecase where no failures occur, once the authoritative RGM receives all ofthe acknowledgements, it notifies the MMC, which then returns a successto the caller. If, however, a given failure event occurs, the protocolensures that the impacted RGM (whether backup or authoritative) removesitself (and potentially the affected node) from service, and a newregion map is issued by the MM leader. Preferably, the RGM removesitself from service by bringing down the JVM although any convenienttechnique may be used. The new map specifies a replacement for the lostregion copy. In this manner, each backup region copy is a “hot standby”for the authoritative region copy and is thus eligible for promotion toauthoritative if and when needed (either because the authoritative RGMfails, for load balancing purposes, or the like).

There are several ways in which the update process can fail. Thus, forexample, the authoritative region manager (while waiting for theacknowledgement) may encounter an exception indicating that the backupmanager process has died or, the backup manager process may fail toprocess the update request locally even though it has issued theacknowledgement or, the backup region manager process while issuing theacknowledgement may encounter an exception indicating that theauthoritative region manager process has died, and so on. As notedabove, if a given backup RGM cannot process the update, it removesitself from service. Moreover, when either a backup RGM or theauthoritative RGM dies, a new region map is issued.

The metadata management system keeps copies of a region synchronized. Anupdate that is done to an object in the authoritative region copy isreplicated on the backup region copies. Once an update is committed bythe authoritative RGM, the same update is applied to all backup regioncopies. The metadata management system ensures that any such failure(whether at the node level, the region manager level or the like) causesreassignment of region copies on the failed node; thus, the integrity ofthe remaining region copies is guaranteed. If a node containing anauthoritative RGM fails, then the backup RGMs are either in sync (withor without a currently executing update), or they are out of sync onlyby the update that was interrupted. In the latter case, re-synchronizingis easy. Because backup regions are kept synchronized with authoritativeregions, a promotion (from backup to authoritative) is instantaneous.

A node failure is also likely to lose backup regions. A backup region isrestored by creating, on some other node, a new, incomplete region. Assoon as the incomplete region is created, it starts recording updatesand starts copying data from the authoritative region. When the copyingis complete, the accumulated updates are applied, resulting in anup-to-date backup. The new backup region then informs the MM leader thatit is up to date, which will cause the MM leader to send out a mapincluding the promotion of the region (from incomplete to backup).

It should be noted that there is no requirement that the number ofregions correspond to the number of nodes. More generally, the number ofregions is uncorrelated with the number of nodes in the array ofindependent nodes. Additional details of the metadata management can befound in U.S. Patent Publication 2006/0026219.

III. Aggregating Query Results by a Node

Exemplary embodiments of the invention allow REST (RepresentationalState Transfer) clients to query a content platform for lists of objectsand metadata that match a given criterion without the need for theintegrating application to traverse a directory, subdirectories,sub-subdirectories, and so forth to retrieve a list of objects andsystem metadata for the given criterion. Features of this inventioninclude the ability for a client application to query by change time,query by directory, query by transaction (create, delete, purge), queryby namespace, and page through results, etc. A single content platformnode distributes the query to all regions across all the nodes in thecontent platform system and the same node sorts the results beforereturning the list back to the client application. According to specificembodiments, the database query is implemented in the Metadata Manager.

“Change time” is the time at which the object (specifically, itsmetadata, since the content in the content platform system is read-only)was last modified by a user. For example, the time is measured in thenumber of milliseconds since Jan. 1, 1970. “Query By Directory” is theact of retrieving all the objects in the content platform system thatlogically reside in the same filesystem directory. The content platformsystem accomplishes this by executing a SQL query against its database.“Query By Transaction” is the act of retrieving all the objects in thecontent platform system whose most recent access was by a certain typeof operation. For example, it could return all the objects whose mostrecent activity was their creation, or all objects that were mostrecently deleted. “Query By Namespace” is the act of retrieving all theobjects, and only those objects, in a particular content platform systemnamespace. “Page Through Results” is the act of iterating over theresult set of a query in sets, rather than in individual objects. Forinstance, a query might be satisfied by 1000 objects. In a traditionaliteration, the client would retrieve and examine those objects one at atime, requiring 1000 iterations. In a paging scheme, they are returnedto the client in batches of 50, 100, or some other number, which reducesthe number of iterations necessary to traverse the results.

III.A. Query Definition

FIG. 5 is a simplified block diagram of a content platform 500illustrating the distribution of a query from a client application 502by a single node 510 to all other nodes 512, 514, 516. The results ofthe query are then filtered and sorted before they are returned to theHTTP client application 502. The content platform 500 includes aredundant array of independent nodes that are networked together. Thequery is processed in each node to provide results of the query byfinding objects that fit the criterion of the query. Filtering the queryresults means including in a result set only results that match thecriterion or criteria given by the REST client. Objects are filtered byoperation type (i.e., “created,” “deleted,” “metadata changed,” etc.).For example, if the client only wishes to see transaction=createrecords, all records visited and only records that matchtransaction=create are included.

In step 1, the application 502 sends a query to the first node orleading node which is the query distributing node 510. In step 2, basedon the request received from the application 502, the first node 510issues a query to each of the other nodes 512, 514, 516 in the contentplatform 500. In step 3, each node in the content platform 500 beginsquerying all authoritative regions within the node and provides resultsin sets. In step 4, the first node 510 continuously retrieves,aggregates, and filters and sorts the results from all the nodes. Instep 5, the first node 510 returns a set of results to the application502. In step 6, the application 502 may issue a request the next set ofresults to the first node 510, and the above steps 2-5 are repeated.Each region preferably maps to a database optimized to handle query onthe object change time through the use of a database index.

FIG. 6 is an example of a flow diagram illustrating a process fordistributing the query from the client application 502 by the first node510 to all other nodes and aggregating and returning results of thequery to the client application 502. In this example, the query selects100 objects in the supplied UUID (Universal Unique Identifier),directory paths, and change_times. The ordering produced by the query is(uuid, change_time, fn_hash).

In step 602, the client application 502 makes a request for a list ofobjects with a certain criterion. In step 604, the first node 510 whichreceives the request issues a query to all the other nodes. In step 606,each node begins query over the regions therein. In step 608, each noderetrieves the first 100 results for each region on the node. In step610, the first node 510 retrieves the initial set of results from allthe nodes. In step 612, the first node aggregates and filters and sortsthe results (this is done continuously until the client application 502stops requesting the next set of results). In step 614, the first node510 returns the results to the client application 502. In step 616, theclient application receives the results until completion (this is doneuntil the client application 502 stops requesting the next set ofresults). In step 618, the client application 502 sends a request forthe next set of results to the first node 502. In step 620, the firstnode 502 request additional results aggregated and filtered and sortedfrom all the nodes until completion (this is done until the clientapplication 502 stops requesting the next set of results).

The process of managing the query results (i.e., issuing and processingquery, and aggregating and filtering results of the query) may beimplemented in a query results management module. In specificembodiments, the query results management module is provided in themetadata manager in each node of the content platform.

III.B. CPExternalFileQueryRequest

The CPExternalFileQueryRequest is a request from the Metadata ManagerClient to a specific Authoritative region number. The request returns 1batch from the external_file table which fits the QueryParameters. TheCPExternalFileQueryRequest will invoke the same query as that describedin the previous section. As described above, the query is ordered by(uuid, change_time, fn_hash). Before returning the batch, the list isfurther sorted (in memory) to produce this exact ordering:

-   -   (uuid, change_time, fn_hash, directory, file_name, version_id).        This feature may be implemented as a software module to provide        communication between the first node 510 and the other nodes for        requesting the next set/batch of results. The “uuid” is a        universally unique identifier for an object. In this case, it        identifies the namespace in which the object resides. The        “change_time” reflects the date and time at which the record was        last modified. The “fn_hash” represents the result of applying a        hash function to the name of an object in a namespace, and is        used as shorthand for identifying the object. See U.S. Patent        Publication 2006/0026219. The “version_id” is a unique        identifier for a particular version of an object in a namespace.

III.C. RemoteQueryBatchIterator

The RemoteQueryBatchIterator is a simple extension of a BatchIteratorwhich sends CPExternalFileQueryRequest messages to retrieve batches.This differs very slightly from typical implementations of BatchIteratorwhich usually query local regions. The query engine is bound to aspecific region number and map size on creation. This feature may beimplemented as a software module to issue a query from the first node510 to the other nodes when the first node 510 receives a request for alist of objects with a certain criterion from the client application502.

III.D. ExternalFileQuery

The ExternalFileQuery class is the MetadataManagerClient Operationimplementation which will merge across all of the query engines in thesystem. Since each query engine returned from theRemoteQueryBatchIterator is strictly ordered, a PriorityQueueIteratorcan merge across these query engines efficiently. The resulting query isordered correctly across all regions. The query returned will be of typeMetadataIterator<ExternalFile>. This feature may be implemented as asoftware module to aggregate and filter the results collected by thefirst node 502 from all the nodes.

The algorithm for merging across all regions is fairly straightforward:(1) iterate all regions in a give node, (2) createRemoteQueryBatchIterator (Region, QueryParameters), (3) createPriorityQueueIterator (Collection<RemoteQueryBatchIterator> iterators,QueryKeyExtractor), and (4) return PriorityQueueIterator.

According to specific embodiments of the invention, the technology foraggregating query results described above is part of the Metadata QueryEngine which helps provide support for content platform integration withsearch engines, backup servers, policy engines, applications using RBS,applications using XAM, or the like.

Of course, the system configurations illustrated in FIGS. 1 and 5 arepurely exemplary of a storage archive in which the present invention maybe implemented, and the invention is not limited to a particularhardware configuration. The computers and storage systems implementingthe invention can also have known I/O devices (e.g., CD and DVD drives,floppy disk drives, hard drives, etc.) which can store and read themodules, programs and data structures used to implement theabove-described invention. These modules, programs and data structurescan be encoded on such computer-readable media. For example, the datastructures of the invention can be stored on computer-readable mediaindependently of one or more computer-readable media on which reside theprograms used in the invention. The components of the system can beinterconnected by any form or medium of digital data communication,e.g., a communication network. Examples of communication networksinclude local area networks, wide area networks, e.g., the Internet,wireless networks, storage area networks, and the like.

In the description, numerous details are set forth for purposes ofexplanation in order to provide a thorough understanding of the presentinvention. However, it will be apparent to one skilled in the art thatnot all of these specific details are required in order to practice thepresent invention. It is also noted that the invention may be describedas a process, which is usually depicted as a flowchart, a flow diagram,a structure diagram, or a block diagram. Although a flowchart maydescribe the operations as a sequential process, many of the operationscan be performed in parallel or concurrently. In addition, the order ofthe operations may be re-arranged.

As is known in the art, the operations described above can be performedby hardware, software, or some combination of software and hardware.Various aspects of embodiments of the invention may be implemented usingcircuits and logic devices (hardware), while other aspects may beimplemented using instructions stored on a machine-readable medium(software), which if executed by a processor, would cause the processorto perform a method to carry out embodiments of the invention.Furthermore, some embodiments of the invention may be performed solelyin hardware, whereas other embodiments may be performed solely insoftware. Moreover, the various functions described can be performed ina single unit, or can be spread across a number of components in anynumber of ways. When performed by software, the methods may be executedby a processor, such as a general purpose computer, based oninstructions stored on a computer-readable medium. If desired, theinstructions can be stored on the medium in a compressed and/orencrypted format.

From the foregoing, it will be apparent that the invention providesmethods, apparatuses and programs stored on computer readable media foraggregating query results in a fault-tolerant database managementsystem. Additionally, while specific embodiments have been illustratedand described in this specification, those of ordinary skill in the artappreciate that any arrangement that is calculated to achieve the samepurpose may be substituted for the specific embodiments disclosed. Thisdisclosure is intended to cover any and all adaptations or variations ofthe present invention, and it is to be understood that the terms used inthe following claims should not be construed to limit the invention tothe specific embodiments disclosed in the specification. Rather, thescope of the invention is to be determined entirely by the followingclaims, which are to be construed in accordance with the establisheddoctrines of claim interpretation, along with the full range ofequivalents to which such claims are entitled.

What is claimed is:
 1. In a system having a plurality of nodes, whereinmetadata objects are stored in a set of regions distributed among thenodes across the system, wherein a region is identified by hashing ametadata object attribute, a method of managing query resultscomprising: receiving, by a first node of the plurality of independentnodes from a client application, a request for a list of objects with acriterion, the request including a query for namespace which identifiesa namespace; issuing by the first node a query to all the nodes based onthe received request; processing the query by each node over the regionsin the node using the metadata objects stored in the regions;aggregating and filtering by the first node results of the query fromparticular nodes of the plurality of nodes, the particular nodes beingassociated with the namespace identified by the query for namespace; andreturning by the first node the aggregated and filtered results to theclient application.
 2. The method according to claim 1, whereinprocessing the query by each node comprises providing the results of thequery in sets to the first node; and wherein the results of the queryfrom the particular nodes are aggregated and filtered and returned tothe client application in sets.
 3. The method according to claim 2,further comprising: after returning by the first node a current set ofthe aggregated and filtered results to the client application, awaitinga request from the client application for a next set of results beforerequesting and retrieving the next set of results from the particularnodes.
 4. The method according to claim 2, wherein providing the resultsof the query in sets to the first node comprises providing a presetnumber of objects from each region as a result of processing the query.5. The method according to claim 1, further comprising: sorting by thefirst node the aggregated and filtered results to produce a presetordering.
 6. The method according to claim 1, wherein the requestincludes one or more of query by change time, query by directory, andquery by transaction.
 7. The method according to claim 1, wherein theregion comprises an authoritative region copy and zero or more backupregion copies acting as backup for the authoritative region copy,wherein the first node issues the query to the nodes which have theauthoritative region copy, and wherein each node which has theauthoritative region copy processes the query over the authoritativeregion copy in said each node.
 8. An apparatus comprising a processorand a memory and which manages query results in a system having aplurality of nodes, wherein metadata objects are stored in a set ofregions distributed among the nodes across the system, wherein a regionis identified by hashing a metadata object attribute, the apparatuscomprising a processor, a memory, and a query results management moduleprovided for each of the nodes, the query results management modulebeing configured to: if the node having the query results managementmodule is a first node which receives from a client application arequest for a list of objects with a criterion, issue a query to all thenodes based on the received request, the request including a query fornamespace which identifies a namespace; process the query over theregions in the node using the metadata objects stored in the regions;and if the node having the query results management module is the firstnode, aggregate and filter results of the query from particular nodes ofall the plurality of nodes, the particular nodes being associated withthe namespace identified by the query for namespace, the aggregated andfiltered results to be returned to the client application.
 9. Theapparatus according to claim 8, wherein processing the query comprisesproviding the results of the query in sets to the first node; andwherein the results of the query from the particular nodes areaggregated and filtered to be returned to the client application insets.
 10. The apparatus according to claim 9, wherein providing theresults of the query in sets to the first node comprises providing apreset number of objects from each region as a result of processing thequery.
 11. The apparatus according to claim 9, wherein if the nodehaving the query results management module is the first node, the queryresults management module is configured, after returning by the firstnode a current set of the aggregated and filtered results to the clientapplication, to await a request from the client application for a nextset of results before requesting and retrieving the next set of resultsfrom the particular nodes.
 12. The apparatus according to claim 8,wherein if the node having the query results management module is thefirst node, the query results management module is configured to sortthe aggregated and filtered results to produce a preset ordering.
 13. Anode in the redundant array of independent nodes according to claim 8,the node comprising a metadata manager to manage the metadata objects inthe node which includes organizing and providing access to the metadataobjects, wherein the metadata manager includes the query resultsmanagement module of the node.
 14. The apparatus according to claim 8,wherein the region comprises an authoritative region copy and zero ormore backup region copies acting as backup for the authoritative regioncopy, wherein the first node issues the query to the nodes which havethe authoritative region copy, and wherein each node which has theauthoritative region copy processes the query over the authoritativeregion copy in said each node.
 15. A non-transitory computer-readablestorage medium storing a plurality of instructions for controlling adata processor to manage query results in a system having a plurality ofnodes, wherein metadata objects are stored in a set of regionsdistributed among the nodes across the system, wherein a region isidentified by hashing a metadata object attribute, wherein thecomputer-readable storage medium is provided in each node, the pluralityof instructions comprising: instructions that cause the data processor,if the node having the computer-readable storage medium is a first nodewhich receives from a client application a request for a list of objectswith a criterion, to issue a query to all the nodes based on thereceived request the request including a query for namespace whichidentifies a namespace; instructions that cause the data processor toprocess the query over the regions in the node using the metadataobjects stored in the regions; and instructions that cause the dataprocessor, if the node having the computer-readable storage medium isthe first node, to aggregate and filter by the first node results of thequery from particular nodes of the plurality of nodes, the particularnodes being associated with the namespace identified by the query fornamespace, the aggregated and filtered results to be returned to theclient application.
 16. The non-transitory computer-readable storagemedium according to claim 15, wherein processing the query comprisesproviding the results of the query in sets to the first node; andwherein the results of the query from the particular nodes areaggregated and filtered and returned to the client application in sets.17. The non-transitory computer-readable storage medium according toclaim 16, wherein the plurality of instructions further comprise:instructions that cause the data processor, if the node having thecomputer-readable storage medium is the first node, after returning bythe first node a current set of the aggregated and filtered results tothe client application, to await a request from the client applicationfor a next set of results before requesting and retrieving the next setof results from the particular nodes.
 18. The non-transitorycomputer-readable storage medium according to claim 16, whereinproviding the results of the query in sets to the first node comprisesproviding a preset number of objects from each region as a result ofprocessing the query.
 19. The non-transitory computer-readable storagemedium according to claim 15, wherein the plurality of instructionsfurther comprise: instructions that cause the data processor, if thenode having the computer-readable storage medium is the first node, tosort by the first node the aggregated and filtered results to produce apreset ordering.
 20. The non-transitory computer-readable storage mediumaccording to claim 15, wherein the request includes one or more of queryby change time, query by directory, and query by transaction.
 21. Thenon-transitory computer-readable storage medium according to claim 15,wherein the region comprises an authoritative region copy and zero ormore backup region copies acting as backup for the authoritative regioncopy, wherein the plurality of instructions further compriseinstructions that cause the data processor, if the node having thecomputer-readable storage medium is the first node, to issue the queryto the nodes which have the authoritative region copy, and wherein theplurality of instructions further comprise instructions that cause thedata processor, if the node having the computer-readable storage mediumhas the authoritative region copy, to process the query over theauthoritative region copy in the node.